<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('职称申报列表')" />
    <th:block th:include="include :: layout-latest-css" />
    <th:block th:include="include :: ztree-css" />
</head>
<body class="gray-bg">
    <div class="ui-layout-west">
        <div class="box box-main">
            <div class="box-header">
                <div class="box-title">
                    <i class="fa icon-grid"></i> 组织机构
                </div>
                <div class="box-tools pull-right">
                    <button type="button" class="btn btn-box-tool" id="btnExpand" title="展开" style="display:none;"><i class="fa fa-chevron-up"></i></button>
                    <button type="button" class="btn btn-box-tool" id="btnCollapse" title="折叠"><i class="fa fa-chevron-down"></i></button>
                    <button type="button" class="btn btn-box-tool" id="btnRefresh" title="刷新部门"><i class="fa fa-refresh"></i></button>
                </div>
            </div>
            <div class="ui-layout-content">
                <div id="tree" class="ztree"></div>
            </div>
        </div>
    </div>
    <div class="ui-layout-center">
         <div class="container-div">
            <div class="row">
                <div class="col-sm-12 search-collapse">
                    <form id="formId">
                        <input type="hidden" id="deptId" name="deptId">
                        <div class="select-list">
                            <ul>
                                <li>
                                    <label>姓名：</label>
                                    <input type="text" name="userName"/>
                                </li>
                                <li>
                                    <label>申报类别：</label>
                                    <select name="professionalType" th:with="type=${@dict.getType('professional_type')}">
                                        <option value="">所有</option>
                                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                    </select>
                                </li>
                                <li>
                                    <label>申报职称：</label>
                                    <select name="professionalName" th:with="type=${@dict.getType('professional_name')}">
                                        <option value="">所有</option>
                                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                    </select>
                                </li>
                                <li>
                                    <label>申报年度：</label>
                                    <input type="text" class="time-input" data-type="year" name="professionalYear"/>
                                </li>
                                <li>
                                    <label>申报职称等级：</label>
                                    <select name="professionalLevel" th:with="type=${@dict.getType('basic_post_level')}">
                                        <option value="">所有</option>
                                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                    </select>
                                </li>
                                <li>
                                    <label>申报方式：</label>
                                    <select name="professionalWay" th:with="type=${@dict.getType('professional_way')}">
                                        <option value="">所有</option>
                                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                    </select>
                                </li>
                                <li>
                                    <label>用户类别：</label>
                                    <select name="userType" th:with="type=${@dict.getType('basic_user_type')}">
                                        <option value="">所有</option>
                                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                    </select>
                                </li>
                                <li>
                                    <label>编制情况：</label>
                                    <select name="workDuty" th:with="type=${@dict.getType('basic_work_duty')}">
                                        <option value="">所有</option>
                                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                    </select>
                                </li>
                                <li>
                                    <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                    <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                                </li>
                            </ul>
                        </div>
                    </form>
                </div>

                <div class="col-sm-12 select-table table-bordered">
                    <table id="bootstrap-table"></table>
                </div>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: layout-latest-js" />
    <th:block th:include="include :: ztree-js" />
    <th:block th:include="include :: bootstrap-table-export-js" />
    <th:block th:include="include :: bootstrap-table-fixed-columns-js" />
    <script th:inline="javascript">
        var prefix = ctx + "report/professional";

        var sexs = [[${@dict.getType('sys_user_sex')}]];
        var educates = [[${@dict.getType('basic_educate_name')}]];
        var types = [[${@dict.getType('professional_type')}]];
        var names = [[${@dict.getType('professional_name')}]];
        var levels = [[${@dict.getType('basic_post_level')}]];
        var majors = [[${@dict.getType('major_type')}]];
        var datas = [[${@dict.getType('sys_yes_no')}]];
        var userTypes = [[${@dict.getType('basic_user_type')}]];

        $(function() {
            var panehHidden = false;
            if ($(this).width() < 769) {
                panehHidden = true;
            }
            $('body').layout({ initClosed: panehHidden, west__size: 185 });
            // 回到顶部绑定
            if ($.fn.toTop !== undefined) {
                var opt = {
                    win:$('.ui-layout-center'),
                    doc:$('.ui-layout-center')
                };
                $('#scroll-up').toTop(opt);
            }
            queryProfessionalList();
            queryDeptTree();
        });

        function queryProfessionalList() {
            var options = {
                url: prefix + "/list",
                modalName: "职称申报",
                showSearch: false,
                showRefresh: false,
                showToggle: false,
                showColumns: false,
                showExport: true,
                fixedColumns: true,
                fixedNumber: 5,
                exportTypes: ['sql', 'excel'], // 导出的文件类型
                exportOptions: {
                    fileName: '职称申报',    // 文件名称设置
                    mso: {
                        worksheetName: '职称申报',
                        //修复导出数字不显示为科学计数法
                        onMsoNumberFormat: function (cell, row, col) {
                            return !isNaN($(cell).text())?'\\@':'';
                        }
                    }
                },
                columns: [
                    {
                        field: 'idCard',
                        title: '身份证号'
                    },
                    {
                        field: 'userName',
                        title: '姓名'
                    },
                    {
                        field: 'sex',
                        title: '性别',
                        formatter: function(value, row, index) {
                            return $.table.selectDictLabel(sexs, value);
                        }
                    },
                    {
                        field: 'birthday',
                        title: '出生年月'
                    },
                    {
                        field: 'userType',
                        title: '用户类别',
                        formatter: function(value, row, index) {
                            return $.table.selectDictLabel(types, value);
                        }
                    },
                    {
                        field: 'score1',
                        title: '继续教育情况（科教科）',
                        formatter: function(value, row, index) {
                            return $.table.selectDictLabel(datas, value);
                        }
                    },
                    {
                        field: 'isPass',
                        title: '继续教育是否合格',
                        formatter: function(value, row, index) {
                            return $.table.selectDictLabel(datas, value);
                        }
                    },
                    {
                        field: 'workTime',
                        title: '参加工作时间'
                    },
                    {
                        field: 'majorYear',
                        title: '专业年限'
                    },
                    {
                        field: 'majorType',
                        title: '现从事专业',
                        formatter: function(value, row, index) {
                            return $.table.selectDictLabel(majors, value);
                        }
                    },
                    {
                        field: 'educateType',
                        title: '评审依据学历',
                        formatter: function(value, row, index) {
                            return $.table.selectDictLabel(educates, value);
                        }
                    },
                    {
                        field: 'educateTime',
                        title: '依据学历取得时间'
                    },
                    {
                        field: 'score2',
                        title: '学历得分（人事科）'
                    },
                    {
                        field: 'postName',
                        title: '现职务资格'
                    },
                    {
                        field: 'obtainTime',
                        title: '现资格取得时间'
                    },
                    {
                        field: 'engageTime',
                        title: '现资格聘任时间'
                    },
                    {
                        field: 'score3',
                        title: '资历得分（人事科）'
                    },
                    {
                        field: 'score4',
                        title: '硬件分（人事科）'
                    },
                    {
                        field: 'score5',
                        title: '考核情况（人事科）'
                    },
                    {
                        field: 'score6',
                        title: '考核得分（人事科）'
                    },
                    {
                        field: 'score7',
                        title: '兼职（人事科）'
                    },
                    {
                        field: 'score8',
                        title: '荣誉（人事科）'
                    },
                    {
                        field: 'score9',
                        title: '荣誉得分（人事科）'
                    },
                    {
                        field: 'score10',
                        title: '科教分值（科教科）'
                    },
                    {
                        field: 'score11',
                        title: '村医（医务科）'
                    },
                    {
                        field: 'score12',
                        title: '带教老师（科教科）'
                    },
                    {
                        field: 'score16',
                        title: '医务科分值（医务科）'
                    },
                    {
                        field: 'score13',
                        title: '软件总分'
                    },
                    {
                        field: 'score14',
                        title: '医务科扣分'
                    },
                    {
                        field: 'score15',
                        title: '纪检监察室扣分'
                    },
                    {
                        field: 'score',
                        title: '合计'
                    },
                    {
                        field: 'professionalName',
                        title: '申报职称',
                        formatter: function(value, row, index) {
                            return $.table.selectDictLabel(names, value);
                        }
                    },
                    {
                        field: 'professionalType',
                        title: '申报类别',
                        formatter: function(value, row, index) {
                            return $.table.selectDictLabel(types, value);
                        }
                    },
                    {
                        field: 'professionalLevel',
                        title: '申报职称等级',
                        formatter: function(value, row, index) {
                            return $.table.selectDictLabel(levels, value);
                        }
                    },
                    {
                        field: 'professionalYear',
                        title: '申报年度'
                    },
                    {
                        field: 'hospitalTime',
                        title: '来院时间'
                    },
                    {
                        field: 'submitTime',
                        title: '提交时间'
                    },
                    {
                        field: 'remark',
                        title: '备注'
                    }]
            };
            $.table.init(options);
        }

        function queryDeptTree()
        {
            var url = ctx + "system/dept/treeData";
            var options = {
                url: url,
                expandLevel: 1,
                onClick : zOnClick
            };
            $.tree.init(options);

            function zOnClick(event, treeId, treeNode) {
                $("#deptId").val(treeNode.id);
                $.table.search();
            }
        }

        $('#btnExpand').click(function() {
            $._tree.expandAll(true);
            $(this).hide();
            $('#btnCollapse').show();
        });

        $('#btnCollapse').click(function() {
            $._tree.expandAll(false);
            $(this).hide();
            $('#btnExpand').show();
        });

        $('#btnRefresh').click(function() {
            queryDeptTree();
        });
    </script>
</body>
</html>